#ifndef _DATAPROXYCOMMUNICATOR_H_
#define _DATAPROXYCOMMUNICATOR_H_

#include "online-certifier/util/typeDefines.hh"
#include "communicatorUtil.hh"
#include <vector>

using namespace std;

class dataProxyCommunicator{

    public:
        dataProxyCommunicator(int port);
        dataProxyCommunicator(int port, vector<string>& sites, char* dir);//for grid5000
        e_status runDataProxyServer();

        e_status writeToDecoder(char* res, fixedBitSizeInteger prime); // to be implemented
        e_status writeRowDataToDecoder(std::string  data);

        e_status checkTerminate(); //check the buffer for termination signal (non blocking call)
        e_status terminate();

        void syncDir();//for grid5000 using rsync command
        void createAllDirs();// grid5000
        void deleteAllDirs();
        bool isGrid(){return grid;}
    private:
        int port;
        int sock;
        int connected; //socketConnected to decoder
        vector<string> grid5kSites;
        string gridOutputDir;

        bool grid;

       

};




#endif
